﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace PDS2
{
    public enum AiState
    {
        Idle,
        Chasing,
        Exhausted,
        Dead
    }
    class Skeleton : Boss
    {
        AiState aiState = AiState.Idle;

        int originalHp;

        public Skeleton()
        {
            Health = 12000;
            Damage = 84;
            speed = 3;
            originalHp = Health;
        }

        public override void LoadContent(ContentManager content)
        {
            texture = content.Load<Texture2D>("GameThumbnail");

            base.LoadContent(content);
        }

        public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            base.Update(gameTime);
            switch (aiState)
            {
                case AiState.Idle:
                    break;
                case AiState.Chasing:
                    Chasing(Vector2.Zero);
                    break;
                case AiState.Exhausted:
                    // Pustar ut
                    break;
                case AiState.Dead:
                    // :(
                    break;
            }
        }

        float PercentHp()
        {
            return (Health / originalHp) * 100;
        }

        void Chasing(Vector2 pos)
        {
            Vector2 direction = Vector2.Normalize(pos - Position);
            Position += direction * speed;
        }
            

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, Position, null, Color.White, 0f, new Vector2(texture.Width / 2, texture.Height / 2),1f, SpriteEffects.None, 0f);

            base.Draw(spriteBatch);
        }
    }
}
